package co.legu.carpool.configure;

import co.legu.carpool.common.interceptor.MybatisCacheClearInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * Mvc 配置
 */
@Configuration
@PropertySource("classpath:/app.properties")
public class MvcConfigurer implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // Mybatis 缓存清理拦截器
        registry.addInterceptor(new MybatisCacheClearInterceptor());
    }
}
